//
//  MyinformFoot.m
//  diaoyuren
//
//  Created by 钓鱼人 on 16/3/17.
//  Copyright © 2016年 game. All rights reserved.
//

#import "MyinformFoot.h"

@implementation MyinformFoot

-(void)awakeFromNib{

    self.backgroundColor = [UIColor clearColor];
    
    [self.NoLogin addTarget:self action:@selector(NoLoginClick) forControlEvents:UIControlEventTouchUpInside];
}

-(void)NoLoginClick{
    
    UIAlertController *aler =  [self.fatherCtrl ShowAlertWhthTitle:@"提示" Message:@"退出登录会删除您的账户记录，将不能进行自动登录,确定退出？" CancelButtonTitle:@"取消"];
    
    UIAlertAction *other = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
        [[Manager sharedManager] ResponseWhithURL:LogoutUrl AndParameter:nil AndCompletionType:^(id responseObject, DIEError *error) {
            self.fatherCtrl.app.isLogin = @"NO";
            NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
            [ud removeObjectForKey:@"userName"];
            [ud removeObjectForKey:@"userPass"];
            
            [self.fatherCtrl.navigationController popViewControllerAnimated:YES];
            
            if (self.fatherCtrl.imageChange) {
                self.fatherCtrl.imageChange();
            }
            
        }];
        
    }];
    [aler addAction:other];
}




@end
